﻿<Window x:Class="VKontakteClient.Main"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Local="clr-namespace:VKontakteClient"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    Title="ВКонтакте (пре-альфа версия. Разработчик №1268439)" Height="700" Width="900" Closing="Window_Closing" Loaded="Window_Loaded">
    <Window.Resources>
        <Local:ButtonTextToColorConverter x:Key="ButtonTextToColor" />
    </Window.Resources>
    <Grid>
        <Menu Margin="0,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch">
            <MenuItem Header="Меню" >
                <MenuItem Header="Настройки..." Click="MenuItem_Click" />
                <MenuItem Header="Просматривать такие страницы в оригинале" Click="SwitchToCoreMode" x:Name="OriginalViewBtn" IsCheckable="True" />
                <MenuItem Header="Проверить обновления..." Click="CheckForUpdates_Click"></MenuItem>
            </MenuItem>
            <MenuItem>
                <MenuItem.Header>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                        <TextBox x:Name="URIViewer" HorizontalAlignment="Stretch" Width="500"></TextBox>
                        <Button Content="GO" HorizontalAlignment="Right" x:Name="NavigateBtn" IsEnabled="False" Click="Button_Click"></Button>
                    </StackPanel>
                </MenuItem.Header>
            </MenuItem>
        </Menu>
        <Local:LogOnControl VerticalAlignment="Center" HorizontalAlignment="Center" Grid.ColumnSpan="2" Authorized="LoginControl_Authorized" x:Name="loginControl"/>
        <Grid x:Name="RealLayer" Visibility="Collapsed" Margin="0,25,0,25">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <ScrollViewer VerticalScrollBarVisibility="Auto">
                <ItemsControl Margin="10" x:Name="Menu" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Top" BorderThickness="0">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Button Content="{Binding Path=Text}" Tag="{Binding Path=Url}" Click="ChangePage" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,5" Background="{Binding Path=Text, Converter={StaticResource ButtonTextToColor}}"/>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </ScrollViewer>
            <Local:Friends Visibility="Collapsed" x:Name="FriendsView" Grid.Column="1" Margin="0,10,10,10" />
            <Local:ProfileControl Visibility="Collapsed" x:Name="ProfileView" Grid.Column="1" Margin="0,10,10,10" />
<!--            <Local:WhatNewAll Visibility="Collapsed" x:Name="WhatNewView" Grid.Column="1" Margin="0,10,10,10"/>-->
            <Local:AudioSearchControl Visibility="Collapsed" x:Name="AudioSearchView" Grid.Column="1" Margin="0,10,10,10"/>
            <Local:AudioRecordsControl Visibility="Collapsed" x:Name="AudioRecordsView" Grid.Column="1" Margin="0,10,10,10"/>
            <Grid Grid.Column="1" Margin="0,10,10,10" x:Name="browserHost" Visibility="Collapsed">
                <Border BorderBrush="Black" BorderThickness="1">
                <WindowsFormsHost Margin="0,0,0,25" >
                    <wf:WebBrowser Navigating="browserCore_Navigating" IsWebBrowserContextMenuEnabled="True" x:Name="browserCore" Navigated="browserCore_Navigated" ProgressChanged="browserCore_ProgressChanged" />
                </WindowsFormsHost>
                </Border>
                <StatusBar Height="25" BorderThickness="1" BorderBrush="Black" VerticalAlignment="Bottom" >
                    <StatusBarItem x:Name="browserProgress" />
                </StatusBar>
            </Grid>    
        </Grid>
        <StatusBar Height="25" BorderThickness="1" BorderBrush="Black" VerticalAlignment="Bottom" HorizontalAlignment="Stretch">
            <StatusBarItem x:Name="GlobalStatus" />
        </StatusBar>
        <Canvas x:Name="Waiter" Background="#7F000000" Visibility="Collapsed" Margin="0,0,0,25"/>
    </Grid>
</Window>
